package zy2;

import java.util.Scanner;

/*
* 3. 利用方法重载，编写三个重载方法，分别求出int类型绝对值，float类型绝对值和double类型绝对值。
* */
public class Load {
    Scanner input = new Scanner(System.in);
    public void load1(int num1){
        if (num1>0){
            num1=num1;
        }else {
            num1 = -1*num1;
        }
        System.out.println(num1);
    }

    public void load1(float num2){
        if (num2>0){
            num2=num2;
        }else {
            num2 = -1*num2;
        }
        System.out.println(num2);
    }

    public void load1(double num3){
        if (num3>0){
            num3=num3;
        }else {
            num3 = -1*num3;
        }
        System.out.println(num3);
    }

    public static void main(String[] args) {
        Load load = new Load();
        load.load1(1);
        load.load1(-1);
        load.load1(2.2);
    }
}
